package com.jeff

import grails.converters.JSON

class AirlineController {
    def scaffold = Airline
	
	def AirlineService airlineService
	
	def getJson = {
		Airline airline = Airline.findByCode(params.code)
		if (!airline) {
			airline = new Airline(name:"Not Found",code:params.code)
		}
		render airline as JSON
	}
	
	def getJsonFromService = {
		render airlineService.findByCodeFromService(params.code) as JSON
	}
}
